Crate input

source ·
Expand description

A flexible structure for user interactions to be used in window frameworks and widgets libraries.

Re-exports

pub use mouse::MouseButton;
pub use keyboard::Key;
pub use controller::ControllerAxisArgs;
pub use controller::ControllerButton;
pub use controller::ControllerHat;
pub use controller::ControllerAxisEvent;
pub use generic_event::GenericEvent;
pub use mouse::MouseCursorEvent;
pub use mouse::MouseRelativeEvent;
pub use mouse::MouseScrollEvent;

Modules

Back-end agnostic controller events.
Trait for generic events
Back-end agnostic keyboard keys.
Back-end agnostic mouse buttons.

Structs

After render arguments.
Button arguments
Close arguments.
Used to identify events arguments provided by traits.
Idle arguments, such as expected idle time in seconds.
Render arguments
Touch arguments
Update arguments, such as delta time in seconds

Enums

Models different kinds of buttons.
Stores button state.
Models all events.
Models input events.
Models loop events.
Models different kinds of motion.
Stores the touch state.

Traits

After rendering and buffers are swapped.
Changed button state.
Window is closing.
When window gets or loses cursor
When window gets or loses focus
When background tasks should be performed
The press of a button
The release of a button
When the next frame should be rendered
When the window is resized
When receiving text from user, such as typing a character
When a touch is started, moved, ended or cancelled.
When the application state should be updated